<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
</body>
<script>

  // const reg = /^[a-z\d]+(\.[a-z\d]+)*@([\da-z](-[\da-z])?)+(\.{1,2}[a-z]+)+$/;
  // 字母数字1+ (. 数字字母1+)0+ @ (数字字母 (- 数字字母)0或1)1+ (.1或2 字母1+)1+
  // const str = "rt45q.wh4t.243@fshd-nbfg-segdvru55..asngesrdh..adsfgn..asdh";
  // const str = "rt45q.wh4t.243@fshd-nbfg-sAgdvru55..asngesrdh..adsfgn..asdh";
  // const str = "rt45q.wh4t.243@fshd-nbfg--sgdvru55..asngesrdh..adsfgn..asdh";
  // const str = "rt45q.wh4t.243@-fshd-nbfg-sgdvru55..asngesrdh..adsfgn..asdh";
  // const str = "rt45q.wh4t.243@fshd-nbfg-sgdvru55..asngesrd5h..adsfgn..asdh";
  // console.log( reg.test(str) );


  // const reg = /^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/;
  // (http s0或1 ://)0或1 (数字字母.-)1+ . .字母2~6 ((/数字字母下划线.空格-)0+)0+ /0或1
  // const str = "https://www.baidu.baidu.baidu.com.com.com/abc/asrgd/1256/asdfhg.jpg"
  // const str = "https://ww_w.baidu.com/abc/asr56/asdfhg.jpg"
  // const str = "https://www.baidu.com/abc/asr*gd/shg.jpg"
  // console.log(reg.test(str));


  // html标签的验证正则
  const reg = /^<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)$/;
  // const reg = /^<([a-z]+)([^<]+)*>(.*)<\/\1>$/;
  // < 字母1+ (除了<的任意字符1+)0+ > 任意字符任意个 </ 重复第一个子串 >
  // const reg = /^<([a-z]+)([^<]+)*\s+\/>$/;
  // < 字母1+ (除了<的任意字符1+)0+ 空格1+ />
  // const str = "<div h4htsr7v='asges456'>z3u4中文neirong</div>";
  // const str = "<div h4htsr7v='asges456' />";
  const str = "<div h4htsr7v='asges456'>z3u4中文neirong</span>";

  console.log(reg.test(str))



  
</script>
</html>